from django import forms
from pypsqueak.profile.models import *

from django.utils.safestring import SafeString
from django.forms.models import modelformset_factory

from pypsqueak.chrome.widgets import ColorPickerWidget
from pypsqueak.chrome.forms import ChromeModelForm

class ProfileUpdateForm(ChromeModelForm):
	avatar = forms.FileField( required=False )
	foreground_font_color = forms.CharField( widget=ColorPickerWidget )
	foreground_canvas_color = forms.CharField( widget=ColorPickerWidget )
	background_font_color = forms.CharField( widget=ColorPickerWidget )
	background_canvas_color = forms.CharField( widget=ColorPickerWidget )

	class Meta:
		model = AbstractProfile


class UserProfileUpdateForm(ProfileUpdateForm):
	avatar = forms.FileField( required=False )
	about = forms.Textarea()
	foreground_font_color = forms.CharField( widget=ColorPickerWidget )
	foreground_canvas_color = forms.CharField( widget=ColorPickerWidget )
	background_font_color = forms.CharField( widget=ColorPickerWidget )
	background_canvas_color = forms.CharField( widget=ColorPickerWidget )

	class Meta:
		model = UserProfile
		exclude = ('user')